﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TOLibrary;

namespace consoleCalculator
{
    class Program
    {
        static void Main(string[] args)
        {           
            try
            {
                Console.Write("请输入数字A：");
                string strNumberA = Console.ReadLine();
                Console.Write("请选择运算符号(+、-、*、/)：");
                string strOperate = Console.ReadLine();
                Console.Write("请输入数字B：");
                string strNumberB = Console.ReadLine();
                string strResult = "";

                Operation oper = OperationLibrary.CreateOperator(strOperate);
                oper.NumberA = Convert.ToDouble(strNumberA);
                oper.NumberB = Convert.ToDouble(strNumberB);

                strResult = oper.GetResult().ToString();

                Console.WriteLine("result: {0}", strResult);

                Console.Read();
                

            }
            catch (Exception)
            {
                
                throw;
            }
        }
    }
}
